import { createRouter, createWebHistory } from 'vue-router'
import HomePage from "../views/HomePage.vue"
import Login from "../views/Login.vue"
import Register from "../views/register.vue"
import Flight from "../views/HangBan/flight.vue"
import CommonFlight from "../views/HangBan/flightCommon.vue"
import Info from "../views/Info/info.vue"
import Bag from "../views/XingLi/baggage.vue"
import BagCommon from  "../views/XingLi/baggageCommon.vue"
import User from "../views/User/user.vue"
import Gate from "../views/Gate/gate.vue"
import CommonGate from "../views/Gate/CommonGate.vue"
import VipLogin from  "../views/vipLogin.vue"
import CommonHomePage from "../views/CommonHomePage.vue"
import UpdateRole from "../views/UpdateRole.vue";
import FlightDate from "../views/HangBan/flightDate.vue"
import CommonFlightDate from "../views/HangBan/CommonFlightDate.vue"
import HangBanUpdate from "../views/UpdateHangBan/update.vue"
import UpdateHistory from "../views/UpdateHangBan/UpdateHistory.vue"
import FlightDelay from  "../views/Delay/flightDelay.vue"
import AirPort from "../views/HangBan/AirPort.vue";
import CommonAirPort from "../views/HangBan/AirportCommon.vue"
import CommonUpdateHistory from "../views/UpdateHangBan/CommonUpdateHistory.vue"
import Commonupdate from "../views/UpdateHangBan/Commonupdate.vue"
export const routes = [
    //  路径/重定向到登录
    {
        path: "/",
        redirect: "/login",
    },
    //  vip用户登录组件
    {
        path: "/vip",
        component:HomePage,
        children:[
            {
                path:'info',
                component:Info,
            },
            {
                path:'flight',
                component:Flight,
            },
            {
                path:'flightDate',
                component:FlightDate,
            },
            {
                path:'bag',
                component:Bag,
            },
            {
                path:'user',
                component: User,
            },
            {
                path:'gate',
                component: Gate,
            },
            {
                path:'hbUpdate',
                component: HangBanUpdate,
            },
            {
                path:'updateHistory',
                component: UpdateHistory,
            },
            {
                path:'flightDelay',
                component: FlightDelay,
            },
            {
                path:'airPort',
                component: AirPort,
            },
        ]
    },
    //普通用户登录组件
    {
        path: "/common",
        component:CommonHomePage,
        children:[
            {
                path:'info',
                component:Info,
            },
            {
                path:'flight',
                component:CommonFlight,
            },
            {
                path:'flightDate',
                component:CommonFlightDate,
            },
            {
                path:'bagCommon',
                component:BagCommon,
            },
            {
                path:'gate',
                component: CommonGate,
            },
            {
                path:'updateHistory',
                component: CommonUpdateHistory,
            },
            {
                path:'hbUpdate',
                component: Commonupdate,
            },
            {
                path:'airPort',
                component: CommonAirPort,
            },

        ]
    },
    //  common登录
    {
        path: "/login",
        component:Login,
    },
    //vip登录
    {
        path: "/vipLogin",
        component:VipLogin,
    },
    //  注册
    {
        path: "/register",
        component:Register,
    },
    {
        path:"/updaterole",
        component: UpdateRole,
    }


]


export const router = createRouter({
    history: createWebHistory(),
    routes,
});

